package com.itheima.lambda;

public class StringHandlerDemo {
    public static void main(String[] args) {
        StringHandler s1 = (String msg) -> {
            System.out.println("我是Lambda实现:"+msg);
        };
        s1.printMessage("HelloWorld");

        useStringHandler((String msg) -> {
            System.out.println("我是Lambda实现:"+msg);
        });
        useStringHandler(System.out::println);
    }
    public static void useStringHandler(StringHandler stringHandler){
        stringHandler.printMessage("itheima");
    }
}

interface StringHandler{
    void printMessage(String msg);
}
